/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.wooxes.client;

/**
 *
 * @author woox
 */
import java.util.ArrayList;
import java.util.Iterator;
import com.google.gwt.user.client.ui.Widget;

/**
 * A helper class for implementers of the SourcesClickEvents interface. This
 * subclass of {@link ArrayList} assumes that all objects added to it will be of
 * type {@link com.google.gwt.user.client.ui.ClickListener}.
 */
public class RightClickListenerCollection extends ArrayList {

  /**
   * Fires a click event to all listeners.
   * 
   * @param sender the widget sending the event.
   */
  public void fireClick(Widget sender, int x, int y) {
    for (Iterator it = iterator(); it.hasNext();) {
      RightClickListener listener = (RightClickListener) it.next();
      listener.onRightClick(sender, x, y);
    }
  }
}